﻿using Cyl.Communication;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Logging;
using System.Diagnostics;
using VisionApp.Core.Models;

namespace VisionApp.PostProcess.Net8;

public interface IPostProcessService
{
    void ProcessResults(InspectionResult inspectionResult,ICommDevice commDevice);
}
public class PostProcessService : IPostProcessService
{
    private readonly ILogger<PostProcessService> logger;
    private readonly IMemoryCache cache;

    private ICommDevice? commDevice;
    public PostProcessService(ILogger<PostProcessService> logger,IMemoryCache cache)
    {
        this.logger = logger;
        this.cache = cache;
    }
    public void ProcessResults(InspectionResult inspectionResult, ICommDevice commDevice)
    {
        var isOk = inspectionResult.Result["IsOk"];
        Debug.WriteLine($"示例：{isOk}1表示算法数据有效,0表示无效");
        logger.LogWarning("没有任何数据处理过程");
    }
}
